﻿using System;
using System.Runtime.Serialization;

namespace Simp.CodeModel.Exceptions
{
	/// <summary>Thrown when an unknown function is used.</summary>
	[Serializable()]
	public class UnknownFunctionException : FunctionExceptionBase
	{
		/// <summary>Constructor taking only the function name.</summary>
		/// <param name="functionName"/>
		public UnknownFunctionException(string functionName)
			: base(string.Format("Unknown Function:  {0}", functionName), functionName)
		{
		}

		/// <summary>Constructor taking the function name and a message.</summary>
		/// <param name="message"/>
		/// <param name="functionName"/>
		public UnknownFunctionException(string message, string functionName)
			: base(message, functionName)
		{
		}

		/// <summary>Constructor taking the function name, a message and an inner exception.</summary>
		/// <param name="message"></param>
		/// <param name="inner"></param>
		/// <param name="functionName"/>
		public UnknownFunctionException(string message, Exception inner, string functionName)
			: base(message, inner, functionName)
		{
		}

		/// <summary>Constructor needed for serialization when exception propagates from a remoting server to the client.</summary>
		/// <param name="info"></param>
		/// <param name="context"></param>
		protected UnknownFunctionException(SerializationInfo info, StreamingContext context)
			: base(info, context)
		{
		}
	}
}